/*
 * @Author: SeonHu
 * @Date: 2025-09-16 14:44:19
 * @LastEditors: SeonHu
 * @LastEditTime: 2025-10-14 10:13:13
 * @FilePath: \bg-vben\src\router\routes\modules\report.ts
 * @Description:
 * Copyright © 2020-2025 SANQING Corporation, All rights reserved.
 */
import type { AppRouteModule } from '@/router/types';

import { t } from '@/hooks/web/useI18n';
import { getParentLayout, LAYOUT } from '@/router/constant';

const report: AppRouteModule[] = [
  {
    path: '/report/kanban/designer',
    name: 'KanbanDesigner',
    component: () => import('@/views/report/report/kanban/designer/index.vue'),
    meta: {
      title: t('report.route.report.kanban.designer'),
      hideMenu: true,
    },
  },
  {
    path: '/report/kanban/viewer',
    name: 'KanbanViewer',
    component: () => import('@/views/report/report/kanban/viewer/index.vue'),
    meta: {
      title: t('report.route.report.kanban.viewer'),
      hideMenu: true,
    },
  },
  {
    path: '/report',
    name: 'Report',
    component: LAYOUT,
    redirect: '/report/print',
    meta: {
      orderNo: 8000,
      icon: 'mdi:form-select',
      title: t('report.route.moduleName'),
      roles: [
        'Root.Report.Admin.Print.ReadPrints',
        'Root.Report.Admin.Print.ReadTemplates',
        'Root.Report.Admin.Print.ReadPrintLogs',
        'Root.Report.Admin.DbLink.Read',
        'Root.Report.Admin.Kanban.ReadSimple',
        'Root.Report.Admin.Sheet.ReadSimple1',
        'Root.Report.Rpt.GetKanbansSimple',
        'Root.Report.Rpt.GetSheetsSimple1',
      ],
    },
    children: [
      // =============================打印管理 start=============================
      {
        path: 'print',
        name: 'PrintPage',
        component: getParentLayout('PrintPage'),
        redirect: '/report/print/printsetup',
        meta: {
          icon: 'clarity:printer-line',
          title: t('report.route.print.title'),
          roles: [
            'Root.Report.Admin.Print.ReadPrints',
            'Root.Report.Admin.Print.ReadTemplates',
            'Root.Report.Admin.Print.ReadPrintLogs',
          ],
        },
        children: [
          {
            path: 'printsetup',
            name: 'PrintSetupPage',
            component: () => import('@/views/report/print/printsetup/index.vue'),
            meta: {
              icon: 'mdi:printer-pos-cog-outline',
              title: t('report.route.print.printSetup.title'),
              ignoreKeepAlive: false,
              roles: ['Root.Report.Admin.Print.ReadPrints', 'Root.Report.Admin.Print.ReadTemplates'],
            },
          },
          {
            path: 'printlog',
            name: 'PrintLogPage',
            component: () => import('@/views/report/print/printlog/index.vue'),
            meta: {
              icon: 'mdi:printer-pos-play-outline',
              title: t('report.route.print.printLog.title'),
              ignoreKeepAlive: false,
              roles: ['Root.Report.Admin.Print.ReadPrintLogs'],
            },
          },
        ],
      },
      // =============================打印管理 end===============================
      // =============================报表管理 start=============================
      {
        path: 'report',
        name: 'ReportPage',
        component: getParentLayout('ReportPage'),
        redirect: '/report/report/datasource',
        meta: {
          icon: 'tabler:device-desktop-analytics',
          title: t('report.route.report.title'),
          roles: [
            'Root.Report.Admin.DbLink.Read',
            'Root.Report.Admin.Kanban.ReadSimple',
            'Root.Report.Admin.Sheet.ReadSimple1',
          ],
        },
        children: [
          {
            path: 'dbLink',
            name: 'DbLinkPage',
            component: () => import('@/views/report/report/dblink/index.vue'),
            meta: {
              icon: 'fluent:database-link-24-regular',
              title: t('report.route.report.dbLink.title'),
              ignoreKeepAlive: false,
              roles: ['Root.Report.Admin.DbLink.Read'],
            },
          },
          {
            path: 'kanban',
            name: 'KanbanPage',
            component: () => import('@/views/report/report/kanban/index.vue'),
            meta: {
              icon: 'mdi:monitor-dashboard',
              title: t('report.route.report.kanban.title'),
              ignoreKeepAlive: false,
              roles: ['Root.Report.Admin.Kanban.ReadSimple'],
            },
          },
          {
            path: 'sheet',
            name: 'SheetPage',
            component: () => import('@/views/report/report/sheet/index.vue'),
            meta: {
              icon: 'mdi:microsoft-excel',
              title: t('report.route.report.sheet.title'),
              ignoreKeepAlive: false,
              roles: ['Root.Report.Admin.Sheet.ReadSimple1'],
            },
          },
        ],
      },
      // =============================报表管理 end===============================
      // =============================我的看板 start=============================
      {
        path: 'mykanban',
        name: 'MyKanbanPage',
        component: () => import('@/views/report/kanban/index.vue'),
        meta: {
          icon: 'mdi:monitor-dashboard',
          title: t('report.route.myKanban.title'),
          ignoreKeepAlive: false,
          roles: ['Root.Report.Rpt.GetKanbansSimple'],
        },
      },
      // =============================我的看板 end===============================
      // =============================我的表格 start=============================
      {
        path: 'mysheet',
        name: 'MySheetPage',
        component: () => import('@/views/report/sheet/index.vue'),
        meta: {
          icon: 'mdi:microsoft-excel',
          title: t('report.route.mySheet.title'),
          ignoreKeepAlive: false,
          roles: ['Root.Report.Rpt.GetSheetsSimple1'],
        },
      },
      // =============================我的表格 end===============================
    ],
  },
];

export default report;
